import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index')
  },
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/layout',
    name: 'Layout',
    component: () => import('@/views/layout'),
    children: [
      {
        path: 'home',
        component: () => import('@/views/layout/home')
      },
      {
        path: 'watchLive',
        component: () => import('@/views/layout/watchLive')
      },
      {
        path: '',
        redirect: 'watchLive'
      },
      {
        path: 'hotNews',
        component: () => import('@/views/layout/hotNews')
      },
      {
        path: 'circle',
        component: () => import('@/views/layout/circle')
      },
      {
        path: 'system',
        component: () => import('@/views/layout/system')
      },
      {
        path: 'administrator',
        component: () => import('@/views/layout/administrator')
      },
      {
        path: 'user',
        component: () => import('@/views/layout/user')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
